feat: add Runner, RunnerResult, Judge, and Evaluator#180
Merged
Conversation
…b.com:launchdarkly/java-core into mmccarthy/AIC-2665/java-ai-sdk-v-1-0-aievals
…b.com:launchdarkly/java-core into mmccarthy/AIC-2665/java-ai-sdk-v-1-0-aievals
…b.com:launchdarkly/java-core into mmccarthy/AIC-2665/java-ai-sdk-v-1-0-aievals
…b.com:launchdarkly/java-core into mmccarthy/AIC-2665/java-ai-sdk-v-1-0-aievals
Co-authored-by: Cursor <cursoragent@cursor.com>
Base automatically changed from
mmccarthy/AIC-2664/ai-config-tracker-overhaul
to
main
June 25, 2026 16:05
…hy/AIC-2665/java-ai-sdk-v-1-0-aievals
3 tasks
…Key from escaping
tanderson-ld
approved these changes
Jul 1, 2026
tanderson-ld
left a comment
Contributor
There was a problem hiding this comment.
I'm just reviewing from the java-core perspective, not from the AI product perspective.
| * @return a completed future holding the list of judge results; never {@code null} | ||
| */ | ||
| public CompletableFuture<List<JudgeResult>> evaluate(String input, String output) { | ||
| if (isNoop) { |
Contributor
There was a problem hiding this comment.
From my experience with noop pattern, there usually isn't a noop check and instead the noop just doesn't do anything when invoked. Can you derive its noop-ness from the presence of judges instead?
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 99f8c19. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Adds the AIEVALS types —
Runner,RunnerResult,Judge, andEvaluator— and wiresEvaluator.noop()into all config types. Callers can now implement aRunnerto wrap any model provider, construct aJudgeto evaluate AI outputs against a judge prompt with structured{score, reasoning}output, and coordinate multiple judges through anEvaluator.New types
Wraps a model provider SDK.
outputTypecarries a JSON-Schema-like map when structured output is needed. Single-arg overload delegates withoutputType = null.Immutable result of a
Runnerinvocation.parsedis defensively copied and returned as unmodifiable.Evaluates AI output by invoking a runner with a formatted evaluation prompt and parsing the structured response. Sampling gate runs first — below the rate, returns
sampled=falseimmediately. Creates a fresh tracker per evaluation viaconfig.createTracker(). Parsesscore(Number, [0.0, 1.0]) andreasoning(String, optional). Runner exceptions are caught and returned asJudgeResult(success=false)— judge failures are results, not exceptions. Does not calltrackJudgeResult.Coordinates sequential execution of judges. Missing judges skipped with a warning.
Evaluator.noop()returns a singleton whoseevaluateimmediately returns an empty list. For v1.0, all configs receiveEvaluator.noop().Config type changes
AIConfigbase class gains anEvaluatorfield andgetEvaluator()accessor.AICompletionConfigandAIAgentConfigconstructors accept anEvaluator.AIJudgeConfigalways wiresEvaluator.noop()internally — judges do not evaluate themselves.Test plan
./gradlew :lib:sdk:server-ai:testpassesJudgeTest— successful evaluation, score boundary validation (0 and 1), reasoning optional, runner exception handling (caught not rethrown), null/missing parsed output, score out of range, sampling rates (0 always skips, 1 always runs), message formatting, getter accessorsEvaluatorTest— noop returns empty list, noop singleton identity, single/multiple judge execution, missing judge skipped, evaluator does not calltrackJudgeResult, returned future is already completeRunnerResultTest— builder field assignment, immutability, defensive copy of parsed mapNote
Medium Risk
New public API and config constructor changes in server-ai; runtime behavior stays noop until custom evaluators are wired, but Judge paths will invoke external runners when used.
Overview
Introduces the AI evaluation stack for
server-ai: a pluggableRunner/RunnerResultpair for model calls (including optional structuredoutputType), aJudgethat runs judge prompts via the runner and parses{score, reasoning}with sampling and defensive failure handling, and anEvaluatorthat runs configured judges sequentially and returns a completedCompletableFuture.AIConfigand completion/agent configs now carry anEvaluatorexposed viagetEvaluator();LDAIClientImplwiresEvaluator.noop()for all retrieved configs in v1.0 (judge configs always noop internally). Unit tests cover judge scoring, sampling, evaluator orchestration, andRunnerResultimmutability.Reviewed by Cursor Bugbot for commit aa028c1. Bugbot is set up for automated code reviews on this repo. Configure here.